﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="type_new.aspx.cs" Inherits="AnyOffice.general.system.workflow.flow_type.type_new" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
	<HEAD>
		<title>新建流程</title>
		<meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
		<meta name="CODE_LANGUAGE" Content="C#">
		<meta name="vs_defaultClientScript" content="JavaScript">
		<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
		
		<script language="javascript" src="/aspnet_client/core/function.js"></script>
		<SCRIPT language="javascript">
function check_form()
{
  if(document.Form1.ddlSortId.value == "")
  {
	alert("暂无流程分类！");
	return false;
  }
  
  if(document.Form1.txtFlowNo.value == "")
  {
     alert("流程排序号不能为空！");
     document.Form1.txtFlowNo.focus();
     return false;
  } 
 
  if(!checkIsInteger(document.Form1.txtFlowNo.value))
  {
	alert("流程排序号必须为整数！");
	document.Form1.txtFlowNo.focus();
    return false;
  }
  
  if(document.Form1.txtFlowName.value == "")
  {
     alert("流程名称不能为空！");
     document.Form1.txtFlowName.focus();
     return false;
  }
  
  if(document.Form1.ddlFormId.value == "")
  {
	alert("暂无表单！");	
    return false;
  }
  
  if(!checkIsInteger(document.Form1.txtAutoNum.value))
  {
	alert("自动编号计数器必须为整数！");
	document.Form1.txtAutoNum.focus();
    return false;
  }
  
  if(!checkIsInteger(document.Form1.txtAutoLen.value))
  {
	alert("自动编号显示长度必须为整数！");
	document.Form1.txtAutoLen.focus();
    return false;
  }
  return true;
}

function my_tip()
{
   if(document.getElementById("tip").style.display=="none")
      document.getElementById("tip").style.display="";
   else
   	  document.getElementById("tip").style.display="none";
}
		</SCRIPT>
	</HEAD>
	<body class="bodycolor" topmargin="5">
		<form id="Form1" method="post" runat="server">
			<table border="0" width="100%" cellspacing="0" cellpadding="3" class="small">
				<tr>
					<td class="Big"><img src="/images/notify_new.gif" align="absMiddle"><span class="big3">
							新建流程</span><br>
					</td>
				</tr>
			</table>			
			<table border="0" width="90%" cellpadding="2" cellspacing="1" align="center" class="small"
				bgcolor="#000000">
				<tr>
					<td colspan="2" class="TableHeader"><img src="/images/green_arrow.gif" align="absMiddle">
						流程基本属性</td>
				</tr>
				<tr>
					<td nowrap class="TableData">流程分类：</td>
					<td class="TableData">
						<asp:DropDownList id="ddlSortId" runat="server" CssClass="BigSelect"></asp:DropDownList>
						<asp:RequiredFieldValidator id="valrSortId" runat="server" ErrorMessage="暂无流程分类" Display="Dynamic" ControlToValidate="ddlSortId"></asp:RequiredFieldValidator>
					</td>
				</tr>
				<tr>
					<td nowrap class="TableData">流程排序号：</td>
					<td class="TableData">
						<asp:TextBox id="txtFlowNo" runat="server" CssClass="BigInput" Columns="4" MaxLength="4"></asp:TextBox>
						控制同一分类下流程的排序
					</td>
				</tr>
				<tr>
					<td nowrap class="TableData">流程名称：</td>
					<td class="TableData">
						<asp:TextBox id="txtFlowName" runat="server" CssClass="BigInput" Columns="30"></asp:TextBox>
					</td>
				</tr>
				<tr>
					<td nowrap class="TableData">流程类型：</td>
					<td class="TableData">
						<asp:DropDownList id="ddlFlowType" runat="server" CssClass="BigSelect">
							<asp:ListItem Value="1" Selected="True">固定流程</asp:ListItem>
							<asp:ListItem Value="2">自由流程</asp:ListItem>
						</asp:DropDownList>
					</td>
				</tr>
				<tr>
					<td nowrap class="TableData">表单：</td>
					<td class="TableData">
						<asp:DropDownList id="ddlFormId" runat="server" CssClass="BigSelect"></asp:DropDownList>
					</td>
				</tr>
				<tr>
					<td nowrap class="TableData">允许附件：</td>
					<td class="TableData">
						<asp:DropDownList id="ddlFlowDoc" runat="server" CssClass="BigSelect">
							<asp:ListItem Value="True" Selected="True">是</asp:ListItem>
							<asp:ListItem Value="False">否</asp:ListItem>
						</asp:DropDownList>
					</td>
				</tr>
				<tr>
					<td class="TableData" noWrap>流程说明：</td>
					<td class="TableData">
					<asp:textbox id="txtFlowDesc" runat="server" CssClass="BigInput" Rows="2" Columns="40" TextMode=MultiLine></asp:textbox>
					</td>
				</tr>
				<tr>
					<td colspan="2" class="TableHeader"><img src="/images/green_arrow.gif" align="absMiddle">
						工作名称/文号的设定</td>
				</tr>
				<tr>
					<td nowrap class="TableData">自动文号表达式：</td>
					<td class="TableData">
						<asp:TextBox id="txtAutoName" runat="server" CssClass="BigInput" Columns="30"></asp:TextBox>
						&nbsp;&nbsp;<a href="javascript:my_tip()">查看说明</a>
					</td>
				</tr>
				<tr>
					<td nowrap class="TableData">自动编号计数器：</td>
					<td class="TableData">
						<asp:TextBox id="txtAutoNum" runat="server" CssClass="BigInput" MaxLength="8" Columns="11">0</asp:TextBox>
						用于表达式编号标记
					</td>
				</tr>
				<tr>
					<td nowrap class="TableData">自动编号显示长度：</td>
					<td class="TableData">
						<asp:TextBox id="txtAutoLen" runat="server" CssClass="BigInput" MaxLength="2" Columns="4">0</asp:TextBox>
						为0表示按实际编号位数显示
					</td>
				</tr>
				<tr id="tip" style="DISPLAY:none">
					<td nowrap class="TableData">说明：</td>
					<td class="TableData">
						表达式中可以使用以下特殊标记：<br>
						{Y}：表示年<br>
						{M}：表示月<br>
						{D}：表示日<br>
						{H}：表示时<br>
						{I}：表示分<br>
						{S}：表示秒<br>
						{F}：表示流程名<br>
						{U}：表示用户姓名<br>
						{SD}：表示短部门<br>
        				{LD}：表示长部门<br>
						{R}：表示角色<br>
						{N}：表示编号，通过 <u>编号计数器</u> 取值并自动增加计数值<br>
						<br>
						例如，表达式为：成建委发[{Y}]{N}号，编号位数为4<br>
						自动生成文号如：成建委发[2006]0001号<br>
						<br>
						例如，表达式为：BH{N}，编号位数为3<br>
						自动生成文号如：BH001<br>
						<br>
						例如，表达式为：{F}流程（{Y}年{M}月{D}日{H}:{I}）{U}<br>
						自动生成文号如：请假流程（2006年01月01日10:30）张三<br>
						<br>
						可以不填写自动文号表达式，则系统默认按以下格式，如：<br>
						请假流程(2006-01-01 10:30:30)
					</td>
				</tr>
				<tr>
					<td nowrap class="TableData">允许手工输入文号：</td>
					<td class="TableData">
						<asp:DropDownList id="ddlAutoEdit" runat="server" CssClass="BigSelect">
							<asp:ListItem Value="1">允许手工修改文号</asp:ListItem>
							<asp:ListItem Value="0">不允许手工修改文号</asp:ListItem>
							<asp:ListItem Value="2">允许在自动文号前输入前缀</asp:ListItem>
							<asp:ListItem Value="3">允许在自动文号后输入后缀</asp:ListItem>
							<asp:ListItem Value="4">允许在自动文号前后输入前缀和后缀</asp:ListItem>
						</asp:DropDownList>
					</td>
				</tr>
				<tr align="center" class="TableControl">
					<td colspan="2" nowrap>&nbsp; <input type="submit" value="保存" class="BigButton" name="submit" onclick="return check_form();">&nbsp;&nbsp;
						<input type="button" value="返回" class="BigButton" name="back" onClick="history.back();">
					</td>
				</tr>
			</table>
			<br>
			<div class="small1" align=center>
			不明白如何设计表单和设计流程？请参考官方网站下载中心的《工作流使用详解》。
			</div>
			<br>
		</form>
	</body>
</HTML>
